﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Text;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        Label2.Text = "";
        SqlConnection sqlcon = new SqlConnection();
        sqlcon.ConnectionString = ConfigurationManager.ConnectionStrings["SqlConnectionString"].ConnectionString;
        sqlcon.Open();

        SqlCommand sqlcmd = new SqlCommand("select * from qiyejibenxingxi where qrm='" +  (TextBox1.Text) + "'", sqlcon);


        SqlDataReader reader = sqlcmd.ExecuteReader(CommandBehavior.CloseConnection);

        if (reader.Read())
        {
            if (reader["FACT_TYPE"].ToString() == "99")
            {
                Session["guanli"] = "1";
                Response.Redirect("~/ShenBaoGuanLi/Main/GuanLiMain.aspx");
            }
            else {
            Session["qiyeid"] = reader["qyid"];
            Session["qiyeleixing"] = "ybqy";//年报一般企业
            //Response.Redirect("~/ShenBaoGuanLi/QiYeShenHe/YBQY/fengmian.aspx");
            Response.Redirect("~/ybqy/fengmian.aspx"); 
            }
        }

        else
        { Label2.Text = "您的登录码错误！"; }

    }
}
